<?php

namespace plugin\ky_shouyin\app\controller;

use support\Request;

class IndexController extends BaseController
{
    /**
     * 首页
     */
    public function index(Request $request)
    {
        try {
            return $this->view('index/index');
        } catch (\Throwable $e) {
            // 记录错误日志
            error_log($e->getMessage() . "\n" . $e->getTraceAsString());
            return response('Server Error: ' . $e->getMessage());
        }
    }

    /**
     * 欢迎页面
     */
    public function welcome()
    {
        try {
            return $this->view('index/welcome');
        } catch (\Throwable $e) {
            // 记录错误日志
            error_log($e->getMessage() . "\n" . $e->getTraceAsString());
            return response('Server Error: ' . $e->getMessage());
        }
    }
}
